package model

import (
	"common/globals"
	"gorm.io/gorm"
)

type UserHobby struct {
	gorm.Model
	UserId int    `gorm:"column:user_id;type:int;not null" json:"user_id"`
	Hobby  string `gorm:"column:hobby;type:varchar(20);not null" json:"hobby"`
}

func (u *UserHobby) TableName() string {
	return "user_hobby"
}
func (u *UserHobby) Create() error {
	return globals.Db.Create(&u).Error
}
